package com.xianggu.designMode.stateMethod.impl;
// -------------------------- 具体状态类 --------------------------

import com.xianggu.designMode.stateMethod.PlayerState;
import com.xianggu.designMode.stateMethod.context.PlayerContext;

/**
 * 播放中状态：可暂停或停止播放
 */
class PlayingState implements PlayerState {
    @Override
    public void play(PlayerContext context) {
        System.out.println("[播放中] 无需重复点击播放");
    }

    @Override
    public void pause(PlayerContext context) {
        System.out.println("[播放中] 暂停视频");
        context.setState(new PausedState()); // 切换到暂停状态
    }

    @Override
    public void stop(PlayerContext context) {
        System.out.println("[播放中] 停止视频");
        context.setState(new StoppedState()); // 切换到停止状态
    }
}